package net.xmat.webtest.dao.impl;

import net.xmat.webtest.utils.HibernateUtils;

import org.hibernate.Session;

public class HibernateTransaction {
	
	public void execute(IHibernateWork hibernateWork) {
		Session session = HibernateUtils.getSessionFactory().openSession();
		session.beginTransaction();
		hibernateWork.doInTransaction(session);
		session.getTransaction().commit();
		session.close();
	}
	
}
